package neiltwist.cfd.akka;

import static java.util.Arrays.asList;
import akka.actor.ActorRef;
import akka.routing.CyclicIterator;
import akka.routing.InfiniteIterator;
import akka.routing.UntypedLoadBalancer;

public class Router extends UntypedLoadBalancer {
    private final InfiniteIterator<ActorRef> workers;

    public Router(ActorRef[] workers) {
      this.workers = new CyclicIterator<ActorRef>(asList(workers));
    }

    public InfiniteIterator<ActorRef> seq() {
      return workers;
    }
  }
